package com.ydx.meituan.controller;


import com.ydx.meituan.model.params.PostOrderParams;
import com.ydx.meituan.model.response.PostOrderResp;
import com.ydx.meituan.protocol.NetResult;
import com.ydx.meituan.protocol.ResultUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

@RestController
public class MT513Controller {

//    @GetMapping("/get/form")
//    public NetResult<Map> getForm(@Validated TestParams params){
//        String channel = params.getChannel();
//        Integer serviceId = params.getServiceId();
//
//        HashMap<String, String> map = new HashMap<>();
//        map.put("abc","abc");
//        map.put("success","success");
//        return   ResultUtils.buildResult(map);
//    }
//
//
//    @PostMapping("/post/form")
//    public NetResult<Map> postForm(@Validated TestParams params){
//        String channel = params.getChannel();
//        Integer serviceId = params.getServiceId();
//
//        HashMap<String, String> map = new HashMap<>();
//        map.put("abc","abc");
//        map.put("success","success");
//        return   ResultUtils.buildResult(map);
//    }
//
//
//    @PostMapping("/post/json")
//    public NetResult<Map> postJson(@Validated @RequestBody TestParams params){
//        String channel = params.getChannel();
//        Integer serviceId = params.getServiceId();
//
//        HashMap<String, String> map = new HashMap<>();
//        map.put("abc","abc");
//        map.put("success","success");
//        return   ResultUtils.buildResult(map);
//    }



    @PostMapping("/partner/postOrder")
    public NetResult<PostOrderResp> postOrder(@Validated  @ModelAttribute PostOrderParams params){
        PostOrderResp partnerOrderId = new PostOrderResp();
        partnerOrderId.setPartnerOrderId("28739832749183724129");
        return ResultUtils.buildResult(partnerOrderId);
    }



}
